home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / misc / GMSV03B.lha / GamesMaster / Source / E / ScreenDemos / AGAFade.e next >
Encoding:
Text File  |  1996-09-11  |  2.2 KB  |  78 lines

  1. /* AGA Picture
  2. ** -----------
  3. ** Fades in a 32 colour AGA picture (24 bit colour).  And then fades it out.
  4. **
  5. ** Press left mouse button to exit.
  6. */
  7.  
  8. MODULE 'games','games/games'
  9.  
  10. PROC main()
  11.    DEF screen:PTR TO gamescreen, palette:PTR TO LONG, fadestate:LONG,
  12.        loadpic:PTR TO picture
  13.  
  14.    palette := [    $000000,$080808,$101010,$191919,
  15.         $212121,$292929,$313131,$3A3A3A,
  16.         $424242,$4A4A4A,$525252,$5A5A5A,
  17.         $636363,$6B6B6B,$737373,$7B7B7B,
  18.         $848484,$8C8C8C,$949494,$9C9C9C,
  19.         $A5A5A5,$ADADAD,$B5B5B5,$BDBDBD,
  20.         $C5C5C5,$CECECE,$D6D6D6,$7F7F7F,
  21.         $9B9B9B,$707070,$444444,$1E1E1E
  22.           ]:LONG;
  23.  
  24.    screen :=  [    GSV1,0,
  25.         0,0,0,              -> Screen_Mem1/2/3
  26.         0,                  -> Screen link.
  27.         0,                  -> Address of palette.
  28.         0,                  -> Address of rasterlist.
  29.         32,                 -> Amt of colours in palette.
  30.         320,256,320,256,    -> Screen & Pic Height/Width
  31.         5,                  -> Amt of planes.
  32.         0,0,                -> Top of screen offsets, X/Y
  33.         0,0,                -> X/Y counters (for scrolling).
  34.         0,                  -> Special attributes.
  35.         LORES OR COL24BIT,  -> Screen mode.
  36.         INTERLEAVED,        -> Screen type
  37.         0                   -> Reserved area.
  38.           ]:gamescreen;                
  39.  
  40.    loadpic := [    PCV1,0,             -> Version header.
  41.         0,                  -> Destination.
  42.         320,256,            -> Width, Height.
  43.         5,                  -> Amount of Planes.
  44.         32,                 -> Amount of colours.
  45.         palette,            -> Palette (remap).
  46.         LORES OR COL24BIT,  -> Screen mode.
  47.         INTERLEAVED,        -> Destination.
  48.         0                   -> Parameters.
  49.               ]:picture;
  50.  
  51.    IF gmsbase := OpenLibrary('games.library',0)
  52.       SetUserPri()
  53.       IF (Add_Screen(screen) = ERR_OK)
  54.          loadpic.data := screen.memptr1;
  55.          IF (LoadPic('GAMESLIB:data/IFF.Loading',loadpic) = ERR_OK)
  56.             Show_Screen(screen)
  57.  
  58.         fadestate := 0
  59.         REPEAT
  60.           Wait_OSVBL()
  61.           fadestate := Col24_FadeToPalette(screen,fadestate,palette,1)
  62.         UNTIL (fadestate = 0)
  63.  
  64.         Wait_LMB()
  65.  
  66.         fadestate := 0
  67.         REPEAT
  68.           Wait_OSVBL()
  69.           fadestate := Col24_FadeToBlack(screen,fadestate,2)
  70.         UNTIL (fadestate = 0)
  71.  
  72.          ENDIF
  73.     Delete_Screen(screen)        
  74.       ENDIF
  75.    CloseLibrary(gmsbase)
  76.    ENDIF
  77. ENDPROC
  78.